package com.belizer.demo.jackson;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class Demo {
    public static void main(String[] args) throws FileNotFoundException, JsonProcessingException {
        ObjectMapper objectMapper = new ObjectMapper();

        FileInputStream fileInputStream = new FileInputStream("C:\\Users\\Lenovo\\Desktop\\新建 文本文档.txt");


        String fileContent = objectMapper.writeValueAsString(fileInputStream);
        System.out.println(fileContent);
    }
}
